﻿$(function () {
    $('.portalSearch').keypress(function (e) {
        if (e.which == 13) {
            event.preventDefault();

            searchtxt = $(this).val();

            window.location.href = "/pages/portalsearch.aspx?k=" + searchtxt;
        }
    });
});

function UpdateMessage(msg) {
    $('.UpdateMessage').text(msg);
    $('.UpdateMessage').css({ opacity: 0.0, visibility: "visible" }).animate({ opacity: 1.0 }, 2000).animate({ opacity: 0.0 }, 2000);
}


function ReloadJS() {
    $(".likeit").each(function (index) {

        var id = $(this).attr('id').split('-')[1];
        var data = GetAllLikes(id);

    });

    $(".commentWrapper").each(function (index) {

        var id = $(this).attr('id').split('-')[1];
        GetAllComments(id);

    });
    $('.commentor').text(thisUserName);
    readytoUpload();



    $("#dvAtten").unbind("click");
    $("#dvTimesheet").unbind("click");
    $("#dvIssue").unbind("click");

    $('#dvAtten').click(function () {
        $('#divMarkAttendance').slideToggle('slow');
    });

    $('#dvTimesheet').click(function () {
        $('#divTimeSheet').slideToggle('slow');
    });

    $('#dvIssue').click(function () {
        $('#divIssueTracker').slideToggle('slow');
    });

    $('#horizontalTab').responsiveTabs({
        rotate: false,
        startCollapsed: 'accordion',
        collapsible: 'accordion',
        setHash: true,
        disabled: [3, 4],
        activate: function (e, tab) {
            $('.info').html('Tab <strong>' + tab.id + '</strong> activated!');
        },
        activateState: function (e, state) {

            $('.info').html('Switched from <strong>' + state.oldState + '</strong> state to <strong>' + state.newState + '</strong> state!');
        }
    });
    $('.bxsliderNewsSlider').bxSlider({
        displaySlideQty: 1,
        moveSlideQty: 1,
        pager: false,
        captions: true

    });
}

